<template>
  <div class='demo'>
        home---{{userdata.username}}
        <Children />
  </div>
</template>

<script>
import { onMounted,reactive, toRefs,provide} from 'vue';

import Children from "./children/index.vue"
export default {
name:'demo',
components: {
    Children
 },
setup(props) {
const state=reactive({
    userdata:{
        username:"wxj"
    }
})
onMounted(()=>{
    // console.log(state);
})

provide("userdata",state.userdata)

return {
...toRefs(state)
}
}
}
</script>

<style lang='scss' scoped>

</style>
